/// 测试函数泛型
pub fn test() {
    let x1: i32 = 10;
    let x2: f64 = 2.33;
    let x3: &str = "hehe";

    match echo_result(x1) {
        Ok(x) => 
            println!("{}", x),
        Err(e) =>
            println!("{}", e)
    }

    match echo_result(x2) {
        Ok(x) =>
            println!("{}", x),
        Err(e) =>
            println!("{}", e)
    }

    match echo_result(x3) {
        Ok(x) =>
            println!("{}", x),
        Err(e) =>
            println!("{}", e)
    }
}

fn echo_result<T>(x: T) -> Result<T, String> {
    Ok(x)
}